<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <button>点我混蛋</button>
  <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
  <!-- <script>
   axios('http://127.0.0.1:2000').then(res=>{
    console.log(res)
    
   })
  </script> -->


  <script>
    function fn(res){
      console.log(res)
      
    }
  </script>
   <!-- <script src="http://127.0.0.1:2000?fn=fn"> 

  </script> -->

  
  <script>
    document.querySelector('button').addEventListener('click',()=>{
// 点击创建script标签 
      var script = document.createElement('script')
      script.src = 'http://127.0.0.1:2000?fn=fn'
      document.body.append(script)
    })
  </script>
</body>
</html>